﻿MenuPanel = function() {
	MenuPanel.superclass.constructor.call(this, {
		id : 'menu',
		region : 'west',
		title : "系统菜单",
		split : true,
		width : 200,
		minSize : 175,
		maxSize : 500,
		collapsible : true,
		margins : '0 0 5 5',
		cmargins : '0 0 0 0',		
		layout : "accordion",
		layoutConfig : {
				titleCollapse : true,
				animate : true
			},
			items : [ {
				title : "用户管理",
				items : [new UserMenuPanel()]
			},
			{
				title : "基本信息配置",
				items : [new OtherMenuPanel()]
			}]
		});
};
Ext.extend(MenuPanel, Ext.Panel);
// 用户管理菜单
UserMenuPanel=function()
{	//调用基类构造函数
	UserMenuPanel.superclass.constructor.call(this, {
        autoScroll:true,
        animate:true,
        border:false,
        rootVisible:false,
        root:new Ext.tree.TreeNode({
        text: '用户管理',
        draggable:false,
       	expanded:true
   	 })        
    }); 
   this.root.appendChild(new Ext.tree.TreeNode({
   		text:"用户管理",
   		listeners:{'click':function(){
   			var panel=Ext.getCmp("userPanel");
   			if(!panel){
   				panel=new UserPanel();
   			}
   			main.openTab(panel);
   			}}	
   		}));  
  }
Ext.extend(UserMenuPanel, Ext.tree.TreePanel);
//其他
OtherMenuPanel = function() {
	OtherMenuPanel.superclass.constructor.call(this, {
		autoScroll : true,
		animate : true,
		border : false,
		rootVisible : false,
		root : new Ext.tree.TreeNode( {
			text : '基本信息配置',
			draggable : false,
			expanded : true
		})
	});
}
Ext.extend(OtherMenuPanel, Ext.tree.TreePanel);

